<%@page import="cn.edu.cdtu.healthserver.utils.ConnectUtil"%>
<%@page import="cn.edu.cdtu.healthserver.domain.UserInformation"%>
<%@page import="java.util.List"%>
<%@page import="cn.edu.cdtu.healthserver.service.impl.UserServiceImplementation"%>
<%@page import="cn.edu.cdtu.healthserver.service.UserService"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
UserService userService = new UserServiceImplementation();
List<UserInformation> userList = userService.getUserList();
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>《天天I健康》后台管理系统</title>
<link rel="stylesheet" href="style/backstage.css">
</head>

<body>
<%
String result = (String)session.getAttribute(ConnectUtil.Admin.Result.RESULT_MESSAGE);
if(result != null && !"".equals(result)){
	%>
	<script type="text/javascript">
	alert("<%=result%>");
	</script>
	<%
	session.setAttribute(ConnectUtil.Admin.Result.RESULT_MESSAGE, "");
	result = null;
}
%>
    <div class="head">
            <div class="logo fl"><a href="#"></a></div>
            <h3 class="head_text fr">《天天I健康》后台管理系统</h3>
    </div>
        <div class="operation_user clearfix">
        <div class="link fr">
            <a href="./index.jsp" class="icon icon_i">首页</a><span></span>
        </div>
    </div>
    <div class="content clearfix">
        <div class="main">
        
            <!--右侧内容-->
            <div class="cont">
                <div class="title">用户列表</div>
                <div class="details">
                	<form action="<%=ConnectUtil.Admin.ADMIN_USER_SERVLET %>" method="post">
                	<input type="hidden" id="<%=ConnectUtil.Admin.Option.ADMIN_OPTION%>"
                	name="<%=ConnectUtil.Admin.Option.ADMIN_OPTION%>"
                	value="<%=ConnectUtil.Admin.Option.OptionValue.ADMIN_ADD_USER %>" />
                	<div class="details_operation clearfix">
                		<table>
                		<tbody>
                		<tr>
                		<td>帐号：</td>
                		<td>
                		<input type="text" style="border: 2px solid gray;"
                		id="<%=ConnectUtil.Admin.Pargram.NEW_USER_ACCOUNT %>"
                		name="<%=ConnectUtil.Admin.Pargram.NEW_USER_ACCOUNT %>"/>
                		</td>
                		<td>密码：</td>
                		<td>
                		<input type="password" style="border: 2px solid gray;"
                		id="<%=ConnectUtil.Admin.Pargram.NEW_USER_PASSWORD %>"
                		name="<%=ConnectUtil.Admin.Pargram.NEW_USER_PASSWORD %>"/>
                		</td>
                		<td>名字：</td>
                		<td>
                		<input type="text" style="border: 2px solid gray;"
                		id="<%=ConnectUtil.Admin.Pargram.NEW_USER_NAME %>"
                		name="<%=ConnectUtil.Admin.Pargram.NEW_USER_NAME %>"/>
                		</td>
                		<td>
                		<div class="bui_select">
                            <input type="submit" value="添加用户" class="add">
                        </div>
                        </td>
                		</tr>
                		</tbody>
                		</table>
                    </div>
                	</form>
                	<form action="" method="post">
                    <div class="details_operation clearfix">
                        <div class="bui_select">
                            <input type="button" value="删除选中" class="add"
                            onclick="javascript:alert('暂不支持')">
                        </div>
                    </div>
                    <!--表格-->
                    <table class="table" >
                        <thead>
                            <tr>
                                <th align="center" width="10%">编号</th>
                                <th align="center" width="30%">账号</th>
                                <th align="center" width="30%">密码</th>
                                <th align="center">名字</th>
                            </tr>
                        </thead>
                        <tbody>
                            <%for(UserInformation user:userList){%>
                            <tr>
                                <td align="center">
                                <input type="checkbox" id="<%=user.getId()%>" class="check">
                                <label for="<%=user.getId()%>" class="label">
                                <%=user.getId()%>
                                </label>
                                </td>
                                <td align="center"><%=user.getAccount()%></td>
                                <td align="center"><%=user.getPassword()%></td>
                                <td align="center"><%=user.getName()%></td>
                            </tr>
                            <%} %>
                        </tbody>
                    </table>
                    </form>
                </div>
            </div>
        </div>
        
        
        <!--左侧列表-->
        <div class="menu">
            <div class="cont">
                <div class="title">管理员</div>
                <ul class="mList">
                    <li>
                    	<h3><span>+</span>用户管理</h3>
                        <dl>
                            <dd><a href="<%=ConnectUtil.Admin.ADMIN_JSP_USER_LIST %>">
                            用户列表</a></dd>
                        </dl>
                        <h3><span>+</span>测试题库管理</h3>
                        <dl>
                            <dd><a onclick="javascript:alert('暂不支持')">测试类型管理</a></dd>
                            <dd><a onclick="javascript:alert('暂不支持')">试卷管理</a></dd>
                            <dd><a onclick="javascript:alert('暂不支持')">题目管理</a></dd>
                        </dl>
                        <h3><span>+</span>新闻管理</h3>
                        <dl>
                            <dd><a href="<%=ConnectUtil.Admin.ADMIN_JSP_NEWS %>">
                            更新百度新闻</a></dd>
                        </dl>
                    </li>
                </ul>
            </div>
        </div>

    </div>
</body>
</html>